package com.example.sys.async.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.core.po.BasePo;
import com.example.sys.async.enums.SysASyncType;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@ApiModel(value = "异步信息")
@TableName(value = "sys_async")
public class SysASync extends BasePo<SysASync> {

    @ApiModelProperty(value = "类型")
    @TableField(value = "type")
    private SysASyncType type;

    @ApiModelProperty(value = "处理对象")
    @TableField(value = "target")
    private String target;

    @ApiModelProperty(value = "处理内容")
    @TableField(value = "context")
    private String context;

    @ApiModelProperty(value = "额外参数")
    @TableField(value = "extra_parameter")
    private String extraParameter;

    @ApiModelProperty(value = "完成状态")
    @TableField(value = "completed")
    private boolean completed;

    @ApiModelProperty(value = "成功状态")
    @TableField(value = "successed")
    private boolean successed;

    @ApiModelProperty(value = "异常信息")
    @TableField(value = "error")
    private String error;

    @ApiModelProperty(value = "模块key")
    @TableField(value = "model_key")
    private int modelKey;

    @ApiModelProperty(value = "业务id")
    @TableField(value = "model_id")
    private String modelId;

    @ApiModelProperty(value = "业务名称")
    @TableField(value = "model_name")
    private String modelName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "开始时间")
    @TableField(value = "start_time")
    private Date startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "结束时间")
    @TableField(value = "end_time")
    private Date endTime;
}
